package com.yanqu.road.server.cmd.banquet;

import com.yanqu.road.pb.banquet.CrossBanquetProto;
import com.yanqu.road.pb.worldmessage.WorldMessageProto;
import com.yanqu.road.server.cmd.CrossCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.manager.banquet.CrossBanquetChatMgr;
import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.server.protocol.Protocol;

@Cmd(code = Protocol.C_CROSS_BANQUET_CHAT, desc = "跨服宴会聊天")
public class CrossBanquetChatCmd extends CrossCommand {
    private String banquetId;
    private WorldMessageProto.WorldMessageTempMsg chatMsg;

    @Override
    public boolean parseData(YanQuMessage packet) throws Exception {
        CrossBanquetProto.CrossBanquetChatReqMsg reqMsg = CrossBanquetProto.CrossBanquetChatReqMsg.parseFrom(packet.getBytes());
        banquetId = reqMsg.getBanquetId();
        chatMsg = reqMsg.getMsg();
        return true;
    }

    @Override
    public void execute(YanQuMessage packet) throws Exception {
        CrossBanquetChatMgr.banquetChat(banquetId, chatMsg);
    }

    @Override
    public void sendData() {

    }

}
